#pragma once

#include "fxcc/core/BaseImporter.h"
#include "e2d/core/pch.h"

namespace e2d
{
	struct PrefebCache
	{
		std::vector<MetaMapIndex> m_Prefebs;
	};

	struct PrefebCacheFile
	{
		std::map<std::string, PrefebCache> m_Caches;
	};

	struct Entity;

	struct PrefebImporter :public BaseImporter
	{
		static PrefebCacheFile m_CacheFile;

		static std::string m_CacheFilePath;

		static std::string m_PrefebDir;;
		
		static bool LoadCache();

		static bool SaveCache();

		static std::string GetPrefebPathFromSource(const std::string& soruce);

		static const PrefebCache GetCache(const std::string& source);

		PrefebImporter();

		bool ImportFile(const fxcc::File& file) override;

		bool SaveModelPrefeb(const fxcc::File& file);
		
		bool SaveAudioPrefeb(const fxcc::File& file);

		bool LoadModelData(struct e2d::Entity* entity, const e2d::ModelScene* fbxFile, const e2d::Node* node);
		
		bool LoadAudioData(struct e2d::Entity* entity, const fxcc::File& file);


	};
};